package com.jsbj.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jsbj.user.entities.SysTenantPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 租户菜单表 Mapper 接口
 * </p>
 *
 * @author jsbj
 * @since 2022-03-07
 */
@Mapper
public interface SysTenantPermissionMapper extends BaseMapper<SysTenantPermission> {

    List<SysTenantPermission> findMenuListByUserId(@Param("userId")String id);

    List<SysTenantPermission> getByUserIdAndTenant(@Param("tenantCode")String tenantCode, @Param("userId")String userId);

    List<SysTenantPermission> getByUserIdAndTenantAndApp(@Param("tenantCode") String tenantCode, @Param("userId") String userId, @Param("appShow") Integer appShow);

    List<SysTenantPermission> getByUserIdAndTenantAndPc(String tenantCode, String userId, Integer pcShow);

    List<SysTenantPermission> getByTenantCodeAndPc(String tenantCode, Integer pcShow);

    List<SysTenantPermission> getButtonByUserIdAndTenantAndMenuCode(Map<String,Object> params);

    List<SysTenantPermission> getPZByUserIdAndTenant(@Param("tenantCode")String tenantCode, @Param("userId")String userId);

    List<SysTenantPermission> getUserPageByUserIdAndTenant(@Param("tenantCode")String tenantCode, @Param("userId")String userId);

    List<SysTenantPermission> getUserPageByTenantCode(String tenantCode);

    List<String> alraedyChoose(@Param("tenantCode") String tenantCode);

    List<SysTenantPermission> getBigScreenByUserIdAndTenant(String tenantCode, String userId);

    List<SysTenantPermission> getByUserIdAndTenantAndAppChild(@Param("tenantCode") String tenantCode, @Param("userId") String userId,
                                                              @Param("appShow") Integer appShow, @Param("parentId") String parentId);

    List<SysTenantPermission> getByUserIdAndTenantAndPcChild(@Param("tenantCode") String tenantCode, @Param("userId") String userId,
                                                             @Param("pcShow") Integer pcShow, @Param("parentId") String parentId);

    List<SysTenantPermission> getTenantPermissionsByRoleId(@Param("roleId")String roleId, @Param("tenantCode")String tenantCode);

    List<SysTenantPermission> getByUserIdAndTenantAndPcHead(@Param("tenantCode")String tenantCode, @Param("userId")String userId, @Param("pcShow")Integer pcShow);

    List<SysTenantPermission> getByTenantCodeAndPcHead(String tenantCode, Integer pcShow);
}
